import React, { Component } from 'react'
import {Route,NavLink,Switch,Redirect,useRoutes,Outlet} from 'react-router-dom'
import News from './News/News'
import Msg from './Msg/Msg'
export default function Home () {
  return (
    <div>
      {/* <NavLink to="/home/news" style={{marginRight:'20px'}} >news</NavLink>
      <NavLink to="/home/msg" >msg</NavLink> */}
       <NavLink to="news" style={{marginRight:'20px'}} >news</NavLink>
      <NavLink to="msg" >msg</NavLink>
      <div style={{height:'20px'}}></div>
      {/* <Switch>
        <Route path='/home/news' component={News}></Route>
        <Route path='/home/msg' component={Msg}></Route>
        <Redirect to='/home/msg'></Redirect>
      </Switch> */}
      {/* 指定子路由组建的展示位置相当于路由出口 */}
      <Outlet/>
    </div>
  )
}
